package pl.kech.pszczyna.domain;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;

@Entity
@NamedQueries(value = 
	{ @NamedQuery(name = Image.GET_BY_CAT_ID, query = "SELECT img FROM Image img WHERE img.galleryCatId = :" + Image.CATEGORY_ID) })
public class Image implements Serializable {
	
	private static final long serialVersionUID = -2872624404252386657L;
	public static final String GET_BY_CAT_ID = "getByCatId";
	public static final String CATEGORY_ID = "categoryID";
	
	private Long id;
	
	String blobKeyStr;
	
	Long galleryCatId;
	
	public Image() {
		
	}
	
	public Image(String blobKeyStr) {
		setBlobKeyStr(blobKeyStr);
	}
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	
	public String getBlobKeyStr() {
		return blobKeyStr;
	}
	public void setBlobKeyStr(String blobKeyStr) {
		this.blobKeyStr = blobKeyStr;
	}

	public Long getGalleryCatId() {
		return galleryCatId;
	}

	public void setGalleryCatId(Long galleryCatId) {
		this.galleryCatId = galleryCatId;
	}
}
